import service from '@/utils/request'

// 设置未读信息
export const changeReadList = (data) => {
    return service({
        method: 'post',
        url: '/msg/changeReadList',
        data
    })
}

// 获取用户信息
export const userInfo = (params) => {
    return service({
        method: 'get',
        url: '/userInfo/info',
        params
    })
}

// 修改密码
export const changePassword = (data) => {
    return service({
        method: 'post',
        url: '/userInfo/changePassword',
        data
    })
}

// 修改name
export const changeName = (data) => {
    return service({
        method: 'post',
        url: '/userInfo/changeName',
        data
    })
}

// 修改sex
export const changeSex = (data) => {
    return service({
        method: 'post',
        url: '/userInfo/changeSex',
        data
    })
}

// 修改email
export const changeEmail = (data) => {
    return service({
        method: 'post',
        url: '/userInfo/changeEmail',
        data
    })
}

// 获得公司名称
export const getCorporateName = (params) => {
    return service({
        method: 'get',
        url: '/setting/getCorporateName',
        params
    })
}

// 修改公司名称 
export const changeCorporateName = (data) => {
    return service({
        method: 'post',
        url: '/setting/changeCorporateName',
        data
    })
}

// 获得公司详情
export const getCorporateInfo = (params) => {
    return service({
        method: 'get',
        url: '/setting/getCorporateInfo',
        params
    })
}


// 获得全部公司详情
export const getAllCorporate = (params) => {
    return service({
        method: 'get',
        url: '/setting/getAllCorporate',
        params
    })
}

// 修改公司---- 
export const setCorporateInfo = (data) => {
    return service({
        method: 'post',
        url: '/setting/setCorporateInfo',
        data
    })
}

// 获取轮播图
export const getSwiper = () => {
    return service({
        method: 'get',
        url: '/setting/getSwiper'
    })
}


// 新建产品管理员
export const addProductManager = (data) => {
    return service({
        method: 'post',
        url: '/userInfo/addProductManager',
        data
    })
}

// 获得产品管理员
export const getProductManager = (data) => {
    return service({
        method: 'post',
        url: '/userInfo/getProductManager',
        data
    })
}

// 修改产品管理员
export const modifyProductManager = (data) => {
    return service({
        method: 'post',
        url: '/userInfo/modifyProductManager',
        data
    })
}

// 删除产品管理员
export const deleteProductManager = (params) => {
    return service({
        method: 'get',
        url: '/userInfo/deleteProductManager',
        params
    })
}

// 获得用户  type 0 全部  1 冻结
export const getUser = (data) => {
    return service({
        method: 'post',
        url: '/userInfo/getUser',
        data
    })
}

// 删除用户
export const deletUser = (params) => {
    return service({
        method: 'get',
        url: '/userInfo/deletUser',
        params
    })
}

// 用户赋权
export const empowerment = (data) => {
    return service({
        method: 'post',
        url: '/userInfo/empowerment',
        data
    })
}
// 更改用户状态  0 正常  1 冻结
export const userChangeType = (data) => {
    return service({
        method: 'post',
        url: '/userInfo/changeType',
        data
    })
}

//获取部门列表
export const getDepartment = () => {
    return service({
        method: 'get',
        url: '/setting/getDepartment'
    })
}

//增加部门
export const addDepartment = (data) => {
    return service({
        method: 'post',
        url: '/setting/addDepartment',
        data
    })
}

//删除部门
export const deleteDepartment = (data) => {
    return service({
        method: 'post',
        url: '/setting/deleteDepartment',
        data
    })
}

//获取产品类型列表
export const getProductType = () => {
    return service({
        method: 'get',
        url: '/setting/getProductType'
    })
}

//增加产品类型
export const addProductType = (data) => {
    return service({
        method: 'post',
        url: '/setting/addProductType',
        data
    })
}

//删除产品类型
export const deleteProductType = (data) => {
    return service({
        method: 'post',
        url: '/setting/deleteProductType',
        data
    })
}
